home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / dev_libs / feelin040718 / demos / notify2.e < prev    next >
Text File  |  2004-08-03  |  3KB  |  89 lines

  1. OPT PREPROCESS
  2.  
  3. MODULE 'feelin','libraries/feelin','utility/hooks'
  4.  
  5. ENUM  FA_Prop_First,
  6.       FA_Numeric_Value
  7.  
  8. PROC main()
  9.    DEF app,win,p1,p2,p3,p4,g,s,ids:PTR TO feelinDynamicEntry,hook:hook
  10.  
  11.    hook.entry := {numeric_hook}
  12.  
  13.    IF feelinbase := OpenLibrary('feelin.library',FV_VERSION)
  14.       app := AppObject,
  15.          FA_Application_Title,        'demo_Notify2',
  16.          FA_Application_Version,      '$VER: demo_Notify2 04.00 (04/01/2003)',
  17.          FA_Application_Copyright,    '©2000 - 2003, Olivier LAVIALE',
  18.          FA_Application_Author,       'Olivier LAVIALE <HaploLaMain@aol.com>',
  19.          FA_Application_Description,  'Testing...',
  20.          FA_Application_Base,         'demo_Notify2',
  21.  
  22.          Child, win := WindowObject,
  23.             FA_Window_Title,  'Feelin : Props',
  24.             FA_Window_Open,   TRUE,
  25.  
  26.             Child, VGroup,
  27.                Child, TextObject, FA_Text,{__Text},FA_SetMax,TRUE, DontChain, End,
  28.  
  29.                Child, p1 := Prop(TRUE,32,16,0),
  30.                Child, p2 := Prop(TRUE,32,08,0),
  31.                Child, p3 := Prop(TRUE,32,04,0),
  32.                Child, p4 := Prop(TRUE,32,02,0),
  33.  
  34.                Child, Bar,
  35.  
  36.                Child, VGroup, FA_SetMax,FV_SetMaxH,
  37.                   Child, s := SliderA(TRUE,0,1024,0),
  38.                      FA_ID,                    "SLDR",
  39.                      FA_Font,                  'Nokia/13',
  40.                      'FA_Numeric_Format',      '<pens style=emboss shadow=halfshadow>Level: %ld',
  41.                      End,
  42.  
  43.                   Child, g := F_NewObjA(FC_Gauge,[
  44.                                         FA_Horizontal,            TRUE,
  45.                                        'FA_Numeric_Min',          0,
  46.                                        'FA_Numeric_Max',          32,
  47.                                        'FA_Numeric_ComputeHook',  hook,
  48.                                         End,
  49.  
  50.                   Child, ScaleObject, End,
  51.                End,
  52.             End,
  53.  
  54.             FA_Window_ActiveObject,p4,
  55.          End,
  56.       End
  57.  
  58.       IF app
  59.          ids := ['FA_Prop_First',0,'FA_Numeric_Value',0,NIL]
  60.  
  61.          F_DynamicResolveTable(ids)
  62.  
  63.          F_DoA(p2,FM_Notify,[F_ID(ids,FA_Prop_First),FV_Notify_Always,p1,FM_Set,2,F_ID(ids,FA_Prop_First),FV_Notify_Value])
  64.          F_DoA(p3,FM_Notify,[F_ID(ids,FA_Prop_First),FV_Notify_Always,p2,FM_Set,2,F_ID(ids,FA_Prop_First),FV_Notify_Value])
  65.          F_DoA(p4,FM_Notify,[F_ID(ids,FA_Prop_First),FV_Notify_Always,p3,FM_Set,2,F_ID(ids,FA_Prop_First),FV_Notify_Value])
  66.  
  67.          F_DoA(s,FM_Notify,[F_ID(ids,FA_Numeric_Value),FV_Notify_Always,g,FM_Set,2,F_ID(ids,FA_Numeric_Value),FV_Notify_Value])
  68.  
  69.          F_DoA(win,FM_Notify,[FA_Window_CloseRequest,TRUE,FV_Notify_Parent,FM_Application_Shutdown,0])
  70.  
  71.          F_DoA(app,FM_Application_Run,NIL)
  72.  
  73.          F_DisposeObj(app)
  74.       ENDIF
  75.  
  76.       CloseLibrary(feelinbase)
  77.    ENDIF
  78. ENDPROC
  79.  
  80. ->PROC numeric_hook
  81. F_HOOKM(numeric_hook,LONG)
  82.    RETURN msg[0] / 32
  83. ENDPROC
  84.  
  85. __Text:
  86.    CHAR '<align=justify><pens style=shadow>Notification example :<br>',
  87.         'four Proportionnals,<br>',
  88.         'a Slider and a Gauge',0
  89.